/// <reference path="./MainModule.ts" />
// Interface
interface IPoint {
    getDist(): number;
}

// Module
module Shapes {

    // Class
    export class Point implements IPoint {
        // Constructor
        constructor (public x: number, public y: number) { }

        // Instance member
        getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); }

        // Static member
        static origin = new Point(0, 0);
    }
}

module PersonProcesser { 
    
    //derived class from  personBase
    export class  Person extends MainModule.PersonBase implements IPerson
    { 
        address: string;
        //Constructor
        constructor (age:number, name:string, addr: string){
            super(age, name);
            this.address = addr;
        }

        getDetails() { return this.name + ' ' + this.age + ' ' + this.address; }
    }
}

// Local variables
var p: IPoint = new Shapes.Point(3, 4);
var dist = p.getDist();


// Local variables
var person : IPerson = new PersonProcesser.Person(20,"abc", "abc street, xyz city")
var details = person.getDetails();